<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.7"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>My Project: Inc/motor_control.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">My Project<span id="projectnumber">&#160;1.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.7 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_f93dfce691d792349f1c14ede440e2e6.html">Inc</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">motor_control.h File Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;stdint.h&gt;</code><br />
<code>#include &quot;main.h&quot;</code><br />
<code>#include &quot;<a class="el" href="ris__protocol_8h_source.html">ris_protocol.h</a>&quot;</code><br />
</div>
<p><a href="motor__control_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">union &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="union_c_o_m_data32.html">COMData32</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_c_o_m_head.html">COMHead</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_servo_comd_v3.html">ServoComdV3</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_motor_data__t.html">MotorData_t</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_low_hz_motor_cmd.html">LowHzMotorCmd</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_master_comd_v3.html">MasterComdV3</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_control_data__t.html">ControlData_t</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_m_o_t_o_r__send.html">MOTOR_send</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_m_o_t_o_r__recv.html">MOTOR_recv</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:aac452bc46d6ba7dffc052fbdce3c0b49"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="motor__control_8h.html#aac452bc46d6ba7dffc052fbdce3c0b49">SET_485_DE_UP</a>()&#160;&#160;&#160;HAL_GPIO_WritePin(RS485_DE_GPIO_Port, RS485_DE_Pin, GPIO_PIN_SET)</td></tr>
<tr class="separator:aac452bc46d6ba7dffc052fbdce3c0b49"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac5596eb7669bf95d04df8a3af59aa2e3"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="motor__control_8h.html#ac5596eb7669bf95d04df8a3af59aa2e3">SET_485_DE_DOWN</a>()&#160;&#160;&#160;HAL_GPIO_WritePin(RS485_DE_GPIO_Port, RS485_DE_Pin, GPIO_PIN_RESET)</td></tr>
<tr class="separator:ac5596eb7669bf95d04df8a3af59aa2e3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a34459715470f547bfb6888131a0d66b7"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="motor__control_8h.html#a34459715470f547bfb6888131a0d66b7">SET_485_RE_UP</a>()&#160;&#160;&#160;HAL_GPIO_WritePin(RS485_RE_GPIO_Port, RS485_RE_Pin, GPIO_PIN_SET)</td></tr>
<tr class="separator:a34459715470f547bfb6888131a0d66b7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7ac1c828eecb507ecb9dd037622d6f03"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="motor__control_8h.html#a7ac1c828eecb507ecb9dd037622d6f03">SET_485_RE_DOWN</a>()&#160;&#160;&#160;HAL_GPIO_WritePin(RS485_RE_GPIO_Port, RS485_RE_Pin, GPIO_PIN_RESET)</td></tr>
<tr class="separator:a7ac1c828eecb507ecb9dd037622d6f03"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a2dcc5ffbe89490312bd6fa48ec63839f"><td class="memItemLeft" align="right" valign="top"><a id="a2dcc5ffbe89490312bd6fa48ec63839f" name="a2dcc5ffbe89490312bd6fa48ec63839f"></a>
uint32_t&#160;</td><td class="memItemRight" valign="bottom"><b>crc32_core</b> (uint32_t *ptr, uint32_t len)</td></tr>
<tr class="separator:a2dcc5ffbe89490312bd6fa48ec63839f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9b99d3a686ba260cc07e3c27f05b78ff"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="motor__control_8h.html#a9b99d3a686ba260cc07e3c27f05b78ff">modify_data</a> (<a class="el" href="struct_m_o_t_o_r__send.html">MOTOR_send</a> *motor_s)</td></tr>
<tr class="separator:a9b99d3a686ba260cc07e3c27f05b78ff"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adbc6c7c20703d929550664c59f40a28b"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="motor__control_8h.html#adbc6c7c20703d929550664c59f40a28b">extract_data</a> (<a class="el" href="struct_m_o_t_o_r__recv.html">MOTOR_recv</a> *motor_r)</td></tr>
<tr class="separator:adbc6c7c20703d929550664c59f40a28b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a78c8bc48fce5a9f4a445e561f5c7b8a6"><td class="memItemLeft" align="right" valign="top">HAL_StatusTypeDef&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="motor__control_8h.html#a78c8bc48fce5a9f4a445e561f5c7b8a6">SERVO_Send_recv</a> (<a class="el" href="struct_m_o_t_o_r__send.html">MOTOR_send</a> *pData, <a class="el" href="struct_m_o_t_o_r__recv.html">MOTOR_recv</a> *rData)</td></tr>
<tr class="separator:a78c8bc48fce5a9f4a445e561f5c7b8a6"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><dl class="section author"><dt>Author</dt><dd>Yichao Zhang (<a href="#" onclick="location.href='mai'+'lto:'+'uni'+'tr'+'ee@'+'qq'+'.co'+'m'; return false;">unitr<span class="obfuscator">.nosp@m.</span>ee@q<span class="obfuscator">.nosp@m.</span>q.com</a>) </dd></dl>
<dl class="section version"><dt>Version</dt><dd>1.0 </dd></dl>
<dl class="section date"><dt>Date</dt><dd>2022-03-04</dd></dl>
<dl class="section copyright"><dt>Copyright</dt><dd>Copyright (c) unitree robotics .co.ltd. 2022 </dd></dl>

<p class="definition">Definition in file <a class="el" href="motor__control_8h_source.html">motor_control.h</a>.</p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a id="ac5596eb7669bf95d04df8a3af59aa2e3" name="ac5596eb7669bf95d04df8a3af59aa2e3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac5596eb7669bf95d04df8a3af59aa2e3">&#9670;&#160;</a></span>SET_485_DE_DOWN</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SET_485_DE_DOWN</td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td>&#160;&#160;&#160;HAL_GPIO_WritePin(RS485_DE_GPIO_Port, RS485_DE_Pin, GPIO_PIN_RESET)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="motor__control_8h_source.html#l00165">165</a> of file <a class="el" href="motor__control_8h_source.html">motor_control.h</a>.</p>

</div>
</div>
<a id="aac452bc46d6ba7dffc052fbdce3c0b49" name="aac452bc46d6ba7dffc052fbdce3c0b49"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aac452bc46d6ba7dffc052fbdce3c0b49">&#9670;&#160;</a></span>SET_485_DE_UP</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SET_485_DE_UP</td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td>&#160;&#160;&#160;HAL_GPIO_WritePin(RS485_DE_GPIO_Port, RS485_DE_Pin, GPIO_PIN_SET)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="motor__control_8h_source.html#l00164">164</a> of file <a class="el" href="motor__control_8h_source.html">motor_control.h</a>.</p>

</div>
</div>
<a id="a7ac1c828eecb507ecb9dd037622d6f03" name="a7ac1c828eecb507ecb9dd037622d6f03"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7ac1c828eecb507ecb9dd037622d6f03">&#9670;&#160;</a></span>SET_485_RE_DOWN</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SET_485_RE_DOWN</td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td>&#160;&#160;&#160;HAL_GPIO_WritePin(RS485_RE_GPIO_Port, RS485_RE_Pin, GPIO_PIN_RESET)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="motor__control_8h_source.html#l00168">168</a> of file <a class="el" href="motor__control_8h_source.html">motor_control.h</a>.</p>

</div>
</div>
<a id="a34459715470f547bfb6888131a0d66b7" name="a34459715470f547bfb6888131a0d66b7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a34459715470f547bfb6888131a0d66b7">&#9670;&#160;</a></span>SET_485_RE_UP</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SET_485_RE_UP</td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td>&#160;&#160;&#160;HAL_GPIO_WritePin(RS485_RE_GPIO_Port, RS485_RE_Pin, GPIO_PIN_SET)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="motor__control_8h_source.html#l00167">167</a> of file <a class="el" href="motor__control_8h_source.html">motor_control.h</a>.</p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="adbc6c7c20703d929550664c59f40a28b" name="adbc6c7c20703d929550664c59f40a28b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adbc6c7c20703d929550664c59f40a28b">&#9670;&#160;</a></span>extract_data()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int extract_data </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_m_o_t_o_r__recv.html">MOTOR_recv</a> *&#160;</td>
          <td class="paramname"><em>motor_r</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="_g_o-_m8010-6_8c_source.html#l00075">75</a> of file <a class="el" href="_g_o-_m8010-6_8c_source.html">GO-M8010-6.c</a>.</p>

</div>
</div>
<a id="a9b99d3a686ba260cc07e3c27f05b78ff" name="a9b99d3a686ba260cc07e3c27f05b78ff"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9b99d3a686ba260cc07e3c27f05b78ff">&#9670;&#160;</a></span>modify_data()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int modify_data </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_m_o_t_o_r__send.html">MOTOR_send</a> *&#160;</td>
          <td class="paramname"><em>motor_s</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="_g_o-_m8010-6_8c_source.html#l00050">50</a> of file <a class="el" href="_g_o-_m8010-6_8c_source.html">GO-M8010-6.c</a>.</p>

</div>
</div>
<a id="a78c8bc48fce5a9f4a445e561f5c7b8a6" name="a78c8bc48fce5a9f4a445e561f5c7b8a6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a78c8bc48fce5a9f4a445e561f5c7b8a6">&#9670;&#160;</a></span>SERVO_Send_recv()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">HAL_StatusTypeDef SERVO_Send_recv </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_m_o_t_o_r__send.html">MOTOR_send</a> *&#160;</td>
          <td class="paramname"><em>pData</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_m_o_t_o_r__recv.html">MOTOR_recv</a> *&#160;</td>
          <td class="paramname"><em>rData</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="_g_o-_m8010-6_8c_source.html#l00098">98</a> of file <a class="el" href="_g_o-_m8010-6_8c_source.html">GO-M8010-6.c</a>.</p>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.7
</small></address>
</body>
</html>
